package com.guchenbo.example.thread;

/**
 * @Author guchenbo
 * @Date 2018/10/21.
 */
public class Notify {

    public static void main(String[] args) {
        Notify notify = new Notify();
        notify.test1();
        //        notify.test2();
        notify.test3();

    }

    private void test1() {
        synchronized (this) {
            notify();
        }
    }

    private void test2() {
        notify();
    }

    private void test3() {
        Object obj = new Object();
        synchronized (this) {
            obj.notify();
        }
    }
}
